<?php
namespace app\index\controller;

use app\index\model\User;
use think\Controller;

class Index extends Controller
{
    public function index()
    {
        $fromid = input('fromid', 85);
        $toid = input('toid', 86);
        $from = User::info($fromid);
        $to = User::info($toid);
        if(!$from || !$to){
            $this->error('参数异常');
        }
        $this->assign('fromid',$fromid);
        $this->assign('from_head',$from->headimgurl);
        $this->assign('toid',$toid);
        $this->assign('to_head',$to->headimgurl);
        $this->assign('to_name',$to->nickname);
        return view();
//        return  $this->fetch();
    }

    public function lists(){

        $fromid = input('fromid', 85);
        $this->assign('fromid',$fromid);
        return view();
    }

    public function hello($name = 'ThinkPHP5')
    {
        return 'hello,' . $name;
    }
}
